function deepClone(obj) {
    if (typeof obj !== "object" || obj === null) return obj;

    let result = Array.isArray(obj) ? [] : {};

    for (let key in obj) {
        if (obj.hasOwnProperty(key)) {
            result[key] = deepClone(obj[key]);
        }
    }

    return result;
}

const obj = {
    name: "kahoohak",
    like: {
        something: {
            value: "code",
        },
    },
};

const copy = deepClone(obj);
// const copy = obj;

obj.like.something.value = "sleep";

console.log(copy);
